#include "img.hpp"
#include "prefilter.hpp"

#include <iostream>

void printUsage(const char*);

using namespace std;

int main(int argc, char** argv)
{
	if (argc < 2)
	{
		printUsage(argv[0]);
		return 0;
	}

	image img;

	try
	{
		img.load(argv[1]);
		img.display();
//		prefilter::sharpen(img, 160);
//		prefilter::toGrayscale(img);
//		prefilter::toBlackAndWhite(img);
//		img.canny_edge_detection(1.0f);
		prefilter::removeBackground(img, 0);
		img.display();
	}
	catch (...)
	{
		//TODO: Log error.
	}

	return 0;
}

void printUsage(const char* myName)
{
	cout << "Usage: " << myName << " IMAGE_PATH" << endl;
}

